#pragma once

#include <windows.h>
#include <mmsystem.h>

struct Vector2
{
	float x;
	float y;
};

class SixAxisController
{
private:
	SixAxisController(void);

	JOYINFOEX joystickInfo;
	float axisX, axisY, axisZ, axisR;

public:
	static const int BUTTON_01 = 1;
	static const int BUTTON_02 = 2;
	static const int BUTTON_03 = 4;
	static const int BUTTON_04 = 8;
	static const int BUTTON_05 = 16;
	static const int BUTTON_06 = 32;
	static const int BUTTON_07 = 64;
	static const int BUTTON_08 = 128;
	static const int BUTTON_09 = 256;
	static const int BUTTON_10 = 512;
	static const int UP        = 0;
	static const int RIGHT     = 9000;
	static const int DOWN      = 18000;
	static const int LEFT      = 27000;

	
	~SixAxisController(void);

	static SixAxisController* GetCurrentState(void);

	bool IsButtonPressed(int btn);
	bool IsDPadPressed(int btn);
	Vector2 GetLeftAnalog();
	Vector2 GetRightAnalog();
};
